import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('约束容器'),
        ),
        body: Container(
          color: Colors.blue,
          child: ConstrainedBox(
            constraints: BoxConstraints(minWidth: 50.0, maxHeight: 100),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Container(
                  color: Colors.redAccent,
                  width: 10.0,
                  height: 60.0,
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
